<!DOCTYPE html>
<body>
<script src="../resources/runner.js"></script>
<select id="container"></select>
<script>
var container = document.getElementById('container');
var nodes = [];
var childCount = 1000;
for (var i = 0; i < childCount; ++i) {
    var option = document.createElement('option');
    option.textContent = i;
    nodes.push(option);
}

PerfTestRunner.measureRunsPerSecond({
    description: 'Measures performance of removing option elements from a single-selection select element.',

    run: () => {
        for (var i = 0; i < childCount; ++i) {
            nodes[i].selected = false;
            container.appendChild(nodes[i]);
        }
        container.offsetLeft;
        for (var i = 0; i < childCount; ++i)
            container.removeChild(nodes[i]);
    }
});
</script>
</body>
